#define _CRT_SECURE_NO_WARNINGS 1

int kthToLast(struct ListNode* head, int k)
{
    struct ListNode* fast = head;
    struct ListNode* slow = head;
    int n = k;
    while (n)
    {
        fast = fast->next;
        n--;
    }
    while (fast)
    {
        fast = fast->next;
        slow = slow->next;
    }
    return slow->val;
}